package base.exa11_object;

/**
 * 本实例有助于了解Object测equals机制
 */
public class ObjectEqualsStudy {

    public static void main(String[] args) {
        Object ojb = new Object();
        Object ojb2 = new Object();
        System.out.println("ojb: "+ojb);
        System.out.println("ojb2: " +ojb2);
        //equals在Object默认比较的是地址，故这里返回false
        System.out.println(ojb.equals(ojb2));
        // equals在Object默认比较的是地址，故这里返回true
        System.out.println(ojb.equals(ojb));
    }

}
